package com.malljelly.study.service.impl;

import com.malljelly.study.dao.mapper.MemberMapper;
import com.malljelly.study.dao.po.Member;
import com.malljelly.study.member.vo.back.BackMemberRequestVo;
import com.malljelly.study.service.MemberService;
import com.malljelly.study.trans.MemberVoToMemberPo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by 骑着蜗牛去旅行 on 2018/8/12.
 */
@Service
public class MemberServiceImpl implements MemberService {


    @Autowired
    private MemberMapper memberMapper;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public Integer saveMember(BackMemberRequestVo reqVo) {
        Member po = new MemberVoToMemberPo().apply(reqVo);
        return memberMapper.insertMember(po);
    }
}
